Imports Microsoft.VisualBasic.Compatibility.VB6
Namespace API
    <HideModuleName()> _
    Public Module AppDataFolder
        Private Function ReturnBasePath() As String
            Dim A As String
            If IO.Directory.Exists(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\FMThreeDotOh\") = False Then
                IO.Directory.CreateDirectory(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\FMThreeDotOh\")
                A = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\FMThreeDotOh\"
                Return A
            Else
                A = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\FMThreeDotOh\"
                Return A
            End If
        End Function
        Function ReturnImagePath() As String
            If IO.Directory.Exists(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\FMThreeDotOh\Images") = False Then
                IO.Directory.CreateDirectory(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\FMThreeDotOh\Images")
                Return ReturnBasePath() & "Images\"
            Else
                Return ReturnBasePath() & "Images\"
            End If
        End Function
        Function ReturnTemplatePath() As String
            'If IO.Directory.Exists(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\FMThreeDotOh\Templates") = False Then
            '    IO.Directory.CreateDirectory(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\FMThreeDotOh\Templates")
            '    Return ReturnBasePath() & "Templates\"
            'Else
            '    Return ReturnBasePath() & "Templates\"
            'End If
            Return GetPath() & "\Templates\"
        End Function
        Function ReturnDataPath() As String
            If IO.Directory.Exists(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\FMThreeDotOh\Data") = False Then
                IO.Directory.CreateDirectory(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\FMThreeDotOh\Data")
                Return ReturnBasePath() & "Data\"
            Else
                Return ReturnBasePath() & "Data\"
            End If
        End Function
        Function ReturnCachePath() As String
            If IO.Directory.Exists(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\FMThreeDotOh\Data\Cache") = False Then
                IO.Directory.CreateDirectory(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\FMThreeDotOh\Data\Cache")
                Return ReturnBasePath() & "Data\Cache\"
            Else
                Return ReturnBasePath() & "Data\Cache\"
            End If
        End Function
    End Module
End Namespace